function doAjaxPostSelecionarImagem(idParam, action, idAjax) {
	// get the form values
	var id = idParam;
	$.ajax({
		type : "POST",
		url : "/siphost/paginas/restrito/" + action
				+ ".do?method=selecionarImagem&idImagem=" + id,
		success : function(response) {
			// we have the response
			$('#' + idAjax).html(response);
		},
		error : function(e) {
			alert('Error: ' + e);
		}
	});
}

function doAjaxPostAtualizarImagens(idParam, action, idAjax) {
	// get the form values
	var pagina = idParam;
	$.ajax({
		type : "POST",
		url : "/siphost/paginas/restrito/" + action
				+ ".do?method=atualizarImagens&paginaImagem=" + pagina,
		success : function(response) {
			// we have the response
			$('#' + idAjax).html(response);
		},
		error : function(e) {
			alert('Error: ' + e);
		}
	});
}

/*****************************************************************************/
/********************************** PLANO DE VENDA *********************************/
/*****************************************************************************/
function doAjaxPostTotalizaValorPlanoVenda(idParam, action, idAjax) {
	// get the form values
	var idPlanoVenda = idParam;
	$.ajax({
		type : "POST",
		url : "/siphost/paginas/restrito/" + action
				+ ".do?method=totalizaValorPlanoVenda&idPlanoVendaSelecionado=" + idPlanoVenda,
		success : function(response) {
			// we have the response
			$('#' + idAjax).html(response);
		},
		error : function(e) {
			alert('Error: ' + e);
		}
	});
}

/********************************************************************/
/************************ONIBUS*************************************/
/*******************************************************************/
function doAjaxPostAtualizarTabela(action, metodo, form) {
	var theForm = $("form[name="+form+"]");
	var params = theForm.serialize();
	var actionURL = "/transite/paginas/restrito/"+action+".do?method="+metodo;

	$.ajax({
		type : "POST",
		url : actionURL,
		data : params,
		success: function(response){
			// we have the response
			$('#ajaxTabela').html(response);
		},

		error: function(e){
			alert('Error: ' + e);
		}
	});
}	
